<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>权限分配</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<script type="text/javascript" src="<%=path %>/lib/jquery-1.8.1.min.js"></script>
	<script type="text/javascript" src="<%=path %>/lib/bootstrap/js/bootstrap.min.js"></script>
	<link rel="stylesheet" href="<%=path%>/lib/bootstrap/css/bootstrap.min.css" />
	<link rel="stylesheet" type="text/css" href="<%=path%>/css/xcConfirm.css"/>
	<script src="<%=path%>/js/xcConfirm.js" type="text/javascript" charset="utf-8"></script>

  </head>
  
  <body>
		  <h2 style="padding: 3%;">权限分配</h2>
    <div class="container">
	<div class="row clearfix">
	<div class="col-md-12 column">
			<input type="text" class="search-query" name="" placeholder="输入角色类型 / 角色名称" style="height: 3%;"/>
			<input type="button" class="btn btn-primary" name="" value="查询"/>
		<div class="col-md-12 column">
			<table class="table table-hover">
				<thead>
					<tr>
						<th class="">
							角色姓名
						</th>
						<th>
							状态
						</th>
						<th>
							拥有的权限
						</th>
						<th>
							操作
						</th>
					</tr>
				</thead>
				<tbody>
				
				<c:forEach items="${roleofauthoritys }" var="roleofauthority" varStatus="col">
					<tr class="${col.count%2==0?'':'info' }">
						<td>
							${roleofauthority.role.roleName }
						</td>
						<td>
							有效
						</td>
						<td>
							${roleofauthority.authority.permissionName }
						</td>
						<td>
							<a  class="btn btn-warning allot" onclick="roleId=${roleofauthority.role.roleId}">授予</a>
							<a  class="btn btn-danger revoke" onclick="roleId=${roleofauthority.role.roleId}">撤销</a>
						</td>
					</tr>
					</c:forEach>
				</tbody>
			</table>
		</div>
	</div>
		<ul class="pager">
			<li class="previous disabled"><a>上一页</a></li>
			<li>1</li>
			<li class="next disabled" ><a>下一页</a></li>
		</ul>
</div>

		    <script src="js/canvas-nest.min.js" count="200" zindex="-2" opacity="0.5" color="47,135,193" type="text/javascript"></script>
		    <script type="text/javascript">
		    	var roleId = "";
		    	$(".allot").click(function(){
		    		alert(roleId);
		    	});
		    </script>
  </body>
</html>
